\(\int (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}) \, dx\) [2439]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F(-2)]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 23 \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\log \left (-2-b x-2 \sqrt {1+b x+c x^2}\right ) \]

[Out]

ln(-2-b*x-2*(c*x^2+b*x+1)^(1/2))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.17, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {738, 212} \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\text {arctanh}\left (\frac {b x+2}{2 \sqrt {b x+c x^2+1}}\right )+\log (x) \]

[In]

Int[x^(-1) - 1/(x*Sqrt[1 + b*x + c*x^2]),x]

[Out]

ArcTanh[(2 + b*x)/(2*Sqrt[1 + b*x + c*x^2])] + Log[x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rubi steps \begin{align*} \text {integral}& = \log (x)-\int \frac {1}{x \sqrt {1+b x+c x^2}} \, dx \\ & = \log (x)+2 \text {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {2+b x}{\sqrt {1+b x+c x^2}}\right ) \\ & = \tanh ^{-1}\left (\frac {2+b x}{2 \sqrt {1+b x+c x^2}}\right )+\log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.30 \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=2 \log (x)-\log \left (-2-b x+2 \sqrt {1+b x+c x^2}\right ) \]

[In]

Integrate[x^(-1) - 1/(x*Sqrt[1 + b*x + c*x^2]),x]

[Out]

2*Log[x] - Log[-2 - b*x + 2*Sqrt[1 + b*x + c*x^2]]

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.04

method result size
default \(\ln \left (x \right )+\operatorname {arctanh}\left (\frac {b x +2}{2 \sqrt {c \,x^{2}+b x +1}}\right )\) \(24\)

[In]

int(1/x-1/x/(c*x^2+b*x+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

ln(x)+arctanh(1/2*(b*x+2)/(c*x^2+b*x+1)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.30 \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\log \left (x\right ) - \log \left (-\frac {b x - 2 \, \sqrt {c x^{2} + b x + 1} + 2}{x}\right ) \]

[In]

integrate(1/x-1/x/(c*x^2+b*x+1)^(1/2),x, algorithm="fricas")

[Out]

log(x) - log(-(b*x - 2*sqrt(c*x^2 + b*x + 1) + 2)/x)

Sympy [F]

\[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\int \frac {\sqrt {b x + c x^{2} + 1} - 1}{x \sqrt {b x + c x^{2} + 1}}\, dx \]

[In]

integrate(1/x-1/x/(c*x**2+b*x+1)**(1/2),x)

[Out]

Integral((sqrt(b*x + c*x**2 + 1) - 1)/(x*sqrt(b*x + c*x**2 + 1)), x)

Maxima [F(-2)]

Exception generated. \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(1/x-1/x/(c*x^2+b*x+1)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*c-b^2>0)', see `assume?` for
 more detail

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 50 vs. \(2 (21) = 42\).

Time = 0.29 (sec) , antiderivative size = 50, normalized size of antiderivative = 2.17 \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\log \left ({\left | -\sqrt {c} x + \sqrt {c x^{2} + b x + 1} + 1 \right |}\right ) - \log \left ({\left | -\sqrt {c} x + \sqrt {c x^{2} + b x + 1} - 1 \right |}\right ) + \log \left ({\left | x \right |}\right ) \]

[In]

integrate(1/x-1/x/(c*x^2+b*x+1)^(1/2),x, algorithm="giac")

[Out]

log(abs(-sqrt(c)*x + sqrt(c*x^2 + b*x + 1) + 1)) - log(abs(-sqrt(c)*x + sqrt(c*x^2 + b*x + 1) - 1)) + log(abs(
x))

Mupad [B] (verification not implemented)

Time = 9.99 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.17 \[ \int \left (\frac {1}{x}-\frac {1}{x \sqrt {1+b x+c x^2}}\right ) \, dx=\ln \left (\frac {b}{2}+\frac {\sqrt {c\,x^2+b\,x+1}}{x}+\frac {1}{x}\right )+\ln \left (x\right ) \]

[In]

int(1/x - 1/(x*(b*x + c*x^2 + 1)^(1/2)),x)

[Out]

log(b/2 + (b*x + c*x^2 + 1)^(1/2)/x + 1/x) + log(x)